using System.Drawing;
using GTA;
using NativeUI;

namespace CustomPeds.Menus;

public class OnFootSexMenu : Script
{
	public static UIMenu menu = new UIMenu("", TextSetting.ofs_Menu, new Point(0, -107));
	private static bool isMenuInitialized;

	public OnFootSexMenu()
	{
		if (!isMenuInitialized)
		{
			Main.pool.Add(menu);
		menu.SetBannerType(new UIResRectangle());
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_OralStand));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_SexStand));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_Sex2Stand));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_OralSit));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_Oral2Sit));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_SexSit));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_SexLie));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_PoleDance));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_RewardDance));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_ExclusiveSingle));
		menu.AddItem(new UIMenuItem(TextSetting.ofs_MenuItem_ExclusiveDouble));
		menu.RefreshIndex();
		menu.OnItemSelect += OnItemSelect;
		menu.OnMenuClose += OnMenuClose;
		isMenuInitialized = true;
		}
	}

	private void OnIndexChange(UIMenu sender, int index)
	{
	}

	private void OnItemSelect(UIMenu sender, UIMenuItem item, int index)
	{
		switch (index)
		{
		case 0:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.SexOralStand);
			break;
		case 1:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.SexStand);
			break;
		case 2:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.Sex2Stand);
			break;
		case 3:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.SexOralSit);
			break;
		case 4:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.SexOral2Sit);
			break;
		case 5:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.SexSit);
			break;
		case 6:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.SexLie);
			break;
		case 7:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.PoleDance);
			break;
		case 8:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.RewardDance);
			break;
		case 9:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.ExclusiveDanceSingle);
			break;
		case 10:
			OnFootSexScript.InitSexPlay(OnFootSexScript.SexType.ExclusiveDanceDouble);
			break;
		}
		menu.Visible = false;
	}

	private void OnMenuClose(UIMenu sender)
	{
		menu.Visible = false;
		menu.RefreshIndex();
		OnFootSexScript.StageEnd();
	}
}
